//
// main.cpp for 204param in /home/morel_t//Rendu/maths/204param
// 
// Made by thomas morel
// Login   <morel_t@epitech.net>
// 
// Started on  Tue Mar 27 16:55:01 2012 thomas morel
// Last update Thu Apr 26 12:15:39 2012 florian jousseau
//

#include	<iostream>
#include	<iomanip>
#include	"204param.hh"

const t_param	tab[] =
  {
    {"1/(5-2) si x appartient a [2,5]", &function1, 2.f, 5.f},
    {"1-|x| si x appartient a [-1,1]", &function2, -1.f, 1.f},
    {"exp(-x) si x > 0", &function3, 0.f, 100.f},
    {"gauss0,1(x) = 1/sqrt(2pi) * exp(-x^2/2)", &function4, -10.f, 10.f},
    {"gauss3,4(x) = 1/(2 * sqrt(2pi)) * exp(-(x - 3)^2 / 8)", &function5, -10.f, 20.f}
  };

int		main()
{
  for (int i = 0; i < 5; i++)
    {
      std::cout.precision(3);
      std::cout.setf(std::ios::fixed, std::ios::floatfield);
      std::cout << "f(x) = " << tab[i].information << std::endl;
      std::cout << "E(x) = " << esperance(&tab[i]) << std::endl;
      std::cout << "Var(x) = " << variance(&tab[i]) << std::endl;
      if (i < 4)
	std::cout << std::endl;
    }
}
